import { useNavigate } from "react-router-dom";
const Login = () => {
  const navigate = useNavigate()
  const loginTo = () => {
    console.log('login....')
    // 路由携带参数使用search方法
    // navigate('/index?token=token123&id=100&name=zhangsan&name=lisi&name=wangwu')
    // 路由携带参数使用params方法
    navigate('/index/visitorList/100/zhangsan')
    // state方式携带参数
    // navigate('/index',{ state: {id: 100, naem: 'zhangsan'}})
    
  }
  return (
    <div>
      <button onClick={loginTo}>登录</button>
    </div>
  );
}

export default Login;